package com.ys.homework;

/**
 * @author CodeYang
 * @Description TODO
 * @Date 2020/12/14 19:43
 */
public class Vehicle {
    double speed;
    double size;

    public Vehicle() {
    }

    public Vehicle(double speed, double size) {
        this.speed = speed;
        this.size = size;
    }

    /**
     * 成员方法
     * 设置 车辆的速度
     */
    void setSpeed(double speed) {
        this.speed = speed;
    }

    /**
     * 移动
     */
    void move() {
        System.out.println("移动:车辆的速度为:"+speed+"m/s"+"体积为:"+size+"kg");
    }

    /**
     * 成员方法
     * 加速
     */
    void speedUp() {
    speed+=10;
    }

    /**
     * 成员方法减速
     */
    void speedDown() {
        this.speed--;
    }
}
